package cn.edu.nju.gitlab.data;

import cn.edu.nju.gitlab.Config;
import cn.edu.nju.gitlab.model.SimpleUser;
import cn.edu.nju.gitlab.model.User;
import rx.Observable;

/**
 * Created by lpt on 2017/5/31.
 */

public class UserData {
    private static UserData instance;
    API apiService= Config.getClient().create(API.class);
    public static UserData getInstance() {
        if (instance == null)
            instance = new UserData();
        return instance;
    }

    private UserData() {
        super();
    }

    public Observable<User> getUserInfo(String username, String password) {
        SimpleUser su = new SimpleUser();
        su.setPassword(password);
        su.setUsername(username);
        Observable<User> call = apiService.getUserInfo(su);
        return call;
    }

}
